﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Services;

public partial class Admin_Default : System.Web.UI.Page
{
    ContactController contactController = new ContactController();
    public List<Contact> contacts = new ContactController().GetListContactAll();
    public List<News> news = new NewsController().GetListNewsAll();
    UsersController usersController = new UsersController();
    ProductsController productsController = new ProductsController();
    OrderController orderController = new OrderController();
    ConfigController configController = new ConfigController();
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (string.IsNullOrEmpty(Convert.ToString(Session["login"])))
        //{
        //    Response.Redirect("Login.aspx");
        //}
        
        if(!IsPostBack)
        {
            //Tong so thanh vien
            lblUser.Text = usersController.GetAll().Rows.Count+"";
            //Tong so san pham
            lblProduct.Text = productsController.countProductActive()+ "";
            //Tong so don hang
            lblOrder.Text = orderController.countOrderActive()+"";
            lblDescription.Text = configController.GetAll().Rows[0][3].ToString();
        }
    }
}